package domain;

import java.util.HashMap;
import java.util.Map;

public class ProductCatalog {
    private Map<ItemID, ProductDescription> descriptions = new HashMap<>();

    public ProductCatalog() {
        // 样例数据
        ItemID id1 = new ItemID(100);
        ItemID id2 = new ItemID(200);
        Money price1 = new Money(10.00);
        Money price2 = new Money(20.00);

        ProductDescription desc1 = new ProductDescription(id1, price1, "Product 1");
        ProductDescription desc2 = new ProductDescription(id2, price2, "Product 2");

        descriptions.put(id1, desc1);
        descriptions.put(id2, desc2);
    }

    public ProductDescription getProductDescription(ItemID id) {
        return descriptions.get(id);
    }

    public void addProduct(ItemID id, Money price, String description) {
        ProductDescription product = new ProductDescription(id, price, description);
        descriptions.put(id, product);
    }
}